package com.javabi.sizeof.definition;

import java.io.PrintStream;
import java.util.Set;

import com.javabi.sizeof.ClassDefinition;
import com.javabi.sizeof.ClassDefinitionMap;

/**
 * A Double Array Definition.
 */
public final class DoubleArrayDefinition extends ClassDefinition<double[]> {

	@Override
	public long sizeOf(double[] array) {
		return sizeOfLongArray(array.length);
	}

	@Override
	public long sizeOfDebug(double[] array, ClassDefinitionMap definitionMap, Set<Object> instanceSet, PrintStream stream) throws IllegalAccessException {
		long arraySize = sizeOfLongArray(array.length);
		stream.println("new double[" + array.length + "] " + arraySize + " bytes");
		return arraySize;
	}

}
